import { createStore, Store, useStore as useVuexStore } from "vuex";

import { IRootState, IStoreType } from "./types";

import recommend from "./recommend/recommend";
import player from "./player/player";

const store = createStore<IRootState>({
  state: () => {
    return {
      name: "yzh",
      age: 18
    }
  },
  modules: {
    recommend,
    player
  }
})

export function useStore(): Store<IStoreType> {
  return useVuexStore()
}

export default store